import { getRandomImage, getUserInfo, loginByPassword, loginByPhone, sendSmsCode } from './auth'
import {
  getFinanceAdvanceApplicationById,
  getFinanceAttachmentByPage,
  getFinanceExpenseReimbursementById,
  getFinancePaymentApplicationById,
  getInvoicApplyRecordById,
  getReceiptRecordRefundById,
  getSysSettlementDetails,
  listSysFinancePayChannel,
} from './finance'
import { getWxCode, logout, refreshToken, wxLogin } from './login'
import {
  getBpmTaskStatusDict,
  getInvoiceTypeDict,
  getLogisticsFreightTypeDict,
  getLogisticsPayTypeDict,
  getSysOwnerFreightPage,
  getUserTenantDepartTree,
  queryAllEmployee,
  queryCompanyNew,
} from './system'
import {
  getBusinessStageNodes,
  getProcessDefinition,
  getProcessInstance,
  getSysActBusinessLogByList,
  getTaskByProcessInstanceId,
  getTodoList,
  getTodoTaskPage,
} from './workflow'

/**
 * API接口统一导出
 */
export const api = {
  /**
   * 认证相关接口
   */
  auth: { getRandomImage, sendSmsCode, loginByPhone, loginByPassword, getUserInfo },
  /**
   * 登录相关接口
   */
  login: { refreshToken, logout, getWxCode, wxLogin },
  /**
   * 工作流相关接口
   */
  workflow: {
    getTodoList,
    getTodoTaskPage,
    getTaskByProcessInstanceId,
    getProcessInstance,
    getSysActBusinessLogByList,
    getBusinessStageNodes,
    getProcessDefinition,
  },
  /**
   * 财务相关接口
   */
  finance: {
    getFinanceAdvanceApplicationById,
    getFinanceExpenseReimbursementById,
    getFinancePaymentApplicationById,
    getInvoicApplyRecordById,
    getReceiptRecordRefundById,
    getSysSettlementDetails,
    getFinanceAttachmentByPage,
    listSysFinancePayChannel,
  },
  /**
   * 系统相关接口
   */
  system: {
    getUserTenantDepartTree,
    getLogisticsPayTypeDict,
    getInvoiceTypeDict,
    getLogisticsFreightTypeDict,
    getBpmTaskStatusDict,
    queryCompanyNew,
    queryAllEmployee,
    getSysOwnerFreightPage,
  },
}

// 导出单独的API模块，便于按需导入
export {
  getBpmTaskStatusDict,
  getBusinessStageNodes,
  getFinanceAdvanceApplicationById,
  getFinanceAttachmentByPage,
  getFinanceExpenseReimbursementById,
  getFinancePaymentApplicationById,
  getInvoicApplyRecordById,
  getInvoiceTypeDict,
  getLogisticsFreightTypeDict,
  getLogisticsPayTypeDict,
  getProcessDefinition,
  getProcessInstance,
  getRandomImage,
  getReceiptRecordRefundById,
  getSysActBusinessLogByList,
  getSysOwnerFreightPage,
  getSysSettlementDetails,
  getTaskByProcessInstanceId,
  getTodoList,
  getTodoTaskPage,
  getUserInfo,
  getUserTenantDepartTree,
  getWxCode,
  listSysFinancePayChannel,
  loginByPassword,
  loginByPhone,
  logout,
  queryAllEmployee,
  queryCompanyNew,
  refreshToken,
  sendSmsCode,
  wxLogin,
}

export default api
